<?php
require("dbFunctions.php");

$qr_code = $_REQUEST['qr_code'];

if( !idIsValid($qr_code, "QR_Code") )
	die("QR Code provided is invalid.");
if( !isPartOfPackage($qr_code) )
	die();
$formattedTopLevel = containerDetailsForResourceInPackage($qr_code);
if( is_null($formattedTopLevel) )
	exit();
else
	die("Resource is part of package. Top level item: \n".containerDetailsForResourceInPackage($qr_code) );
?>
